from time import localtime

table_z=[[1,'吃饭支出','交通银行',247.0,'2016-03-02','家庭聚餐'],[2,'工资收入','现金',11000,'2016-03-17','发工资了'],[3,'服装支出','现金',174.0,'2024-10-2','买了棉衣'],[4,'交通支出','线上支付',200.0,'2025-10-01','外出旅游']]

username=input("请输入用户名：")
password=input("请输入密码：")
if username=='admin'and password=='123456':
    print("管理员登录成功！")
    print("1.添加账务，2.编辑账务,3.删除账务,4.查询账务,5.退出系统")
    for x in range(1,20):
        c=input("请输入要操作的功能序号[1-5]：")
        if c=='1':
            type1=input("请输入计事的类型")
            account=input("请输入账户")
            money=input("请输入金额")
            time1=localtime().tm_year
            time2=localtime().tm_mon
            time3=localtime().tm_mday
            ti=str(time1)+'-'+str(time2)+'-'+str(time3)
            intro=input("请输入说明")
            id1=len(table_z)+1
            table_z.append([id1,type1,account,money,ti,intro])
        elif c=='2':
            id2=input("请输入你想修改的记录ID")
            for y in table_z:
                if y[0] == int(id2):
                    print('ID', "事务类型", "账户", "金额", "    时间    ", "说明")
                    print(y)
            tyc=input("请输入你想修改的类别: 1.事务类型, 2.账户, 3.金额,4.时间, 5.说明")
            content=input("请输入你要修改成的内容")
            for y in table_z:
                    if y[0] == int(id2):
                        print('ID', "事务类型", "账户", "金额", "    时间    ", "说明")
                        y[int(tyc)]=content
                    print(y)
        elif c=='3':
            id3=input("请你输入需要删除的id")
            for y in table_z:
                if y[0] == int(id3):
                    table_z.remove(y)
                    print("删除成功")
        elif c=='4':
            print('ID',"事务类型","账户","金额","    时间    ","说明")
            for x in table_z:
                print(x)
            print()
        elif c=='5':
            break
elif username=='lisi'and password=='123456':
    print("用户登录成功")
    print("1.查询所有 ,2.按条件查询")
    for x in range(1, 20):
        c = input("请输入要操作的功能序号[1-2]：")
        if c=='1':
            print('ID', "事务类型", "账户", "金额", "    时间    ", "说明")
            for x in table_z:
                print(x)
            print()
        elif c=='2':
            ID=input("请输入你要查询的ID")
            for y in table_z:
                if y[0]==int(ID):
                    print('ID', "事务类型", "账户", "金额", "    时间    ", "说明")
                    print(y)
else:
    print("账号或密码出错")